// POJ3128 Leonardo's Notebook, NWERC 2006
// 刘汝佳
#include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
int main() {
  const int NN = 30;
  char B[NN];
  int vis[NN], cnt[NN], T;
  scanf("%d", &T);
  while (T--) {
    scanf("%s", B);
    fill_n(vis, NN, 0), fill_n(cnt, NN, 0);
    for (int i = 0; i < 26; i++)
      if (!vis[i]) {  // 找一个从i开始的循环
        int j = i, n = 0;
        do {
          vis[j] = 1, j = B[j] - 'A', n++;  // 标记j为“已访问”
        } while (j != i);
        cnt[n]++;
      }
    int ok = 1;
    for (int i = 2; i <= 26; i++)
      if (i % 2 == 0 && cnt[i] % 2 == 1) ok = 0;
    puts(ok ? "Yes" : "No");
  }
  return 0;
}
/*
算法分析请参考: 《入门经典训练指南-升级版》2.6节 例题23
*/
// 28740283	sukhoeing POJ	3128 Accepted 0	0.3	652	C++
